package com.findviewbydream.evil.eda.BroadcastReceiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.net.ConnectivityManager;
import android.net.Network;
import android.net.NetworkInfo;
import android.widget.Toast;

import com.findviewbydream.evil.eda.Utils.SuperToast.SuperToast;
import com.findviewbydream.evil.eda.Utils.Utils;

/********************************************
 * 工程名：Eda
 * 包名：com.findviewbydream.evil.eda.BroadcastReceiver
 * 时间：16-7-11 下午9:02
 * 作者：白雨濃 evil
 * 邮箱：evilbai@foxmail.com
 * 内容：
 ********************************************/
public class NetChangeReceiver extends BroadcastReceiver
{
    @Override
    public void onReceive(Context context, Intent intent)
    {
        /*ConnectivityManager connectivityManager = (ConnectivityManager)
                context.getSystemService(Context.CONNECTIVITY_SERVICE);
        NetworkInfo networkInfo = connectivityManager.getActiveNetworkInfo();

        if (networkInfo != null && networkInfo.isAvailable())
            Toast.makeText(context, "net is available", Toast.LENGTH_SHORT).show();
        else
            Toast.makeText(context, "net is not available", Toast.LENGTH_SHORT).show();*/

        switch (Utils.getNetworkType())
        {
            case Utils.NETTYPE_WIFI:
                break;
            case Utils.NETTYPE_CMNET:
            case Utils.NETTYPE_CMWAP:
                Utils.ToastLong("亲,当前处于4G/3G网络模式哦!");
                break;
            case 0:
                Utils.ToastLong("亲,没网了 %>_<%");
                break;
        }

    }
}
